package com.sangeng.enums;

public enum AppHttpCodeEnum {
    // 成功
    SUCCESS(200, "操作成功"),
    // 登录
    NEED_LOGIN(401, "需要登录后操作"),
    NO_OPERATOR_AUTH(403, "无权限操作"),
    SYSTEM_ERROR(500, "出现错误"),
    USERNAME_EXIST(501, "用户名已存在"),
    PHONENUMBER_EXIST(502, "手机号已存在"),
    EMAIL_EXIST(503, "邮箱已存在"),
    REQUIRE_USERNAME(504, "必需填写用户名"),
    LOGIN_ERROR(505, "用户名或密码错误"),
    CONTENTNOTNULL(506, "内容不能为空"),
    FILE_TYPE_ERROR(507, "不符合格式的图片，请上传.png/.jpg后缀的图片"),
    USERNAME_NOT_NULL(508, "用户名不能为空"),
    NICKNAME_NOT_NULL(509, "昵称不能为空"),
    EMAIL_NOT_NULL(510, "邮箱不能为空"),
    PASSWORD_NOT_NULL(511, "密码不能为空"),
    NICKNAME_EXIST(512, "昵称不能重复"),
    CATEGORY_INSERT_FAILED(513, "新增分类失败"),
    CATEGORY_UPDATE_ERROR(514, "更新分类失败"),
    CATEGORY_DELETE_ERROR(515, "删除分类失败"),

    PARAM_ERROR(516, "参数异常"),
    LINK_INSERT_FAILED(517, "新增友链失败"),
    LINK_UPDATE_ERROR(518, "更新友链信息失败"),
    LINK_DELETE_ERROR(519, "删除友链失败"),
    TAG_DELETE_ERROR(520, "删除标签失败"),
    TAG_INSERT_FAILED(521, "新增标签失败"),
    TAG_UPDATE_ERROR(522, "更新标签信息失败"),
    ARTICLE_DELETE_ERROR(523, "删除文章失败"),
    USER_DELETE_ERROR(524,"删除用户失败" ),
    ARTICLE_UPDATE_ERROR(525,"更新文章信息失败" ),
    ROLE_DELETE_ERROR(525,"删除角色失败"  ),
    ROLE_CHANGE_FAILED(526, "改变角色状态失败" ),
    ROLE_UPDATE_ERROR(527, "更新角色失败"  );
    private final int code;
    private final String msg;

    AppHttpCodeEnum(int code, String errorMessage) {
        this.code = code;
        this.msg = errorMessage;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
